home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -seriously_amiga- / misc / ced_html / html / html_table_caption.ced < prev    next >
Text File  |  1999-01-25  |  3KB  |  99 lines

  1. /*
  2. ** html_table_caption.ced
  3. **
  4. ** $VER: html_table_caption.ced 1.1 (12.07.1998)
  5. **
  6. ** Arexx script for HTML v3.2 table caption mark
  7. **
  8. ** This script works with CygnusEd Professional v4.2
  9. **
  10. ** Copyright © Eric BELLE
  11. */
  12.  
  13. /*
  14. **------------------------------------------------------------------------------
  15. **    Initialisation
  16. **------------------------------------------------------------------------------
  17. */
  18.  
  19. OPTIONS RESULTS                            /* Tell CygnusEd to return results. */
  20. NL = '0A'X                                    /* Alias for new line. */
  21. KRETURN = RAWKEY 68                    /* Shortcut to the return key. */
  22. KTAB = RAWKEY 66                        /* Shortcut to the tab key. */
  23. STATUS TABSARESPACES                /* Return TAB mode ("tab" or "space"). */
  24. IF RESULT = 1                                /* Test the TAB mode. */
  25. THEN "TABS = SPACES"                /* Switch TAB mode from "space" to "tab". */
  26. ELSE NOP                                        /* No operation. */
  27. TAB SIZE 1                                    /* Set TAB size proportional to 2 spaces. */
  28.  
  29. /*
  30. **------------------------------------------------------------------------------
  31. **    Table caption
  32. **------------------------------------------------------------------------------
  33. */
  34.  
  35. CaptionMode = "q"
  36. DO WHILE ~(CaptionMode="t" | CaptionMode="b",
  37.                     | CaptionMode=" " | CaptionMode="RESULT")
  38.     GETSTRING "t" '"Caption type: (t)op, (b)ottom?"'
  39.     CaptionMode = RESULT
  40. END
  41.  
  42. IF (CaptionMode="RESULT" | CaptionMode=" ")
  43. THEN EXIT 0
  44. ELSE NOP
  45.  
  46. CaptionPositionMode = "q"
  47. DO WHILE ~(CaptionPositionMode="l" | CaptionPositionMode="c",
  48.                     | CaptionPositionMode="r",
  49.                     | CaptionPositionMode=" " | CaptionPositionMode="RESULT")
  50.     GETSTRING "c" '"Caption position: (l)eft, (c)enter, (r)ight?"'
  51.     CaptionPositionMode = RESULT
  52. END
  53.  
  54. IF (CaptionPositionMode="RESULT" | CaptionPositionMode=" ")
  55. THEN EXIT 0
  56. ELSE NOP
  57.  
  58. /*
  59. **------------------------------------------------------------------------------
  60. **    Html table caption structure
  61. **------------------------------------------------------------------------------
  62. */
  63.  
  64. SELECT
  65.     WHEN (CaptionMode="t") THEN CaptionModeString = " VALIGN=TOP"
  66.     WHEN (CaptionMode="b") THEN CaptionModeString = " VALIGN=BOTTOM"
  67.     OTHERWISE NOP
  68. END
  69.  
  70. SELECT
  71.     WHEN (CaptionPositionMode="c") THEN CaptionPositionModeString = " ALIGN=CENTER"
  72.     WHEN (CaptionPositionMode="l") THEN CaptionPositionModeString = " ALIGN=LEFT"
  73.     WHEN (CaptionPositionMode="r") THEN CaptionPositionModeString = " ALIGN=RIGHT"
  74.     OTHERWISE NOP
  75. END
  76.  
  77. OpenCaption = "<CAPTION" || CaptionModeString || CaptionPositionModeString || ">"
  78. CloseCaption = "</CAPTION>"
  79.  
  80. /*
  81. **------------------------------------------------------------------------------
  82. **    Html table structure
  83. **------------------------------------------------------------------------------
  84. */
  85.  
  86. TEXT OpenCaption
  87. "AUTO-INDENT" ; KTAB
  88. TEXT "Should be modified - Table caption"
  89. "AUTO-INDENT" ; BACKTAB
  90. TEXT CloseCaption
  91.  
  92. /*
  93. **------------------------------------------------------------------------------
  94. **    End of html_table_caption.ced Arexx script
  95. **------------------------------------------------------------------------------
  96. */
  97.  
  98. EXIT 0
  99.